package com.czy.owner.ui.workorder.viewholder;
import android.content.Context;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.czy.owner.R;
import com.czy.owner.entity.MyOrderModel;
import com.czy.owner.utils.TimeUtils;
import com.easyrecycleview.adapter.BaseViewHolder;


/**
 * Created wangyang on 2016/9/8.
 */
public class OrderCreateViewHolder extends BaseViewHolder<MyOrderModel> {
    private TextView tv_order_number;
    private TextView tv_order_item;
    private TextView tv_order_service_time;
    private TextView tv_order_jishi;
    private TextView tv_order_other;
//    private TextView tv_order_dingjing;
    private Button btn_order_paid;
    private Context ctx;


    public OrderCreateViewHolder(ViewGroup parent, Context ctx) {
        super(parent, R.layout.item_order_created);
        tv_order_number = $(R.id.tv_order_number);
        tv_order_item = $(R.id.tv_order_item);
        tv_order_service_time = $(R.id.tv_order_service_time);
        tv_order_jishi = $(R.id.tv_order_jishi);
        tv_order_other = $(R.id.tv_order_other);
//        tv_order_dingjing = $(R.id.tv_order_dingjing);
        btn_order_paid = $(R.id.btn_order_paid);
        this.ctx = ctx;
    }

    @Override
    public void setData(MyOrderModel model) {
        tv_order_number.setText("订单号: " + model.getOrderNumber());
        tv_order_item.setText(model.getServiceList());
        String time = TimeUtils.formatTimeDifference2(model.getServiceTime());
        tv_order_service_time.setText(time);
        tv_order_jishi.setText(model.getOrderEmps());
        tv_order_other.setText(model.getNote());
//        tv_order_dingjing.setText("订金: ￥"+model.getActualDepositAmount());


    }


}
